package com.ioc;

import com.ioc.config.SpringConfig;
import com.ioc.dao.BookDao;
import com.ioc.dao.UserDao;
import com.ioc.service.UserService;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**

 *
 */
public class SpringAOPTest01 {


    public static void main(String[] args) {
        //让Spring加载配置文件
        AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(SpringConfig.class);

        UserDao userDao = (UserDao) ctx.getBean("userDao");
        userDao.update();


    }



}
